﻿@model CmsSiteAdminMap

@if (!Model.IsSpecial)
{
<fieldset class="b-form">
@using (Html.BeginForm("editordelete", "cmsadminsitemap", FormMethod.Post, new { id = "siteMapSaveForm" }))
{
    <ol class="b-form__rows ul-reset g-clear">
        <li class="b-form__row g-clear">
            @Html.LabelFor(p => p.NodeTitle)
            @Html.TextBoxFor(p => p.NodeTitle, new { @class = "text" })
            @Html.ValidationMessageFor(p => p.NodeTitle)
        </li>
        <li class="b-form__row g-clear">
            @Html.LabelFor(p => p.NodeDescription)
            @Html.TextBoxFor(p => p.NodeDescription, new { @class = "text" })
            @Html.ValidationMessageFor(p => p.NodeDescription)
        </li>
        <li class="b-form__row g-clear">
            @Html.LabelFor(p => p.NodeUrl)
            @Html.TextBoxFor(p => p.NodeUrl, new { @class = "text" })
            @Html.ValidationMessageFor(p => p.NodeUrl)
        </li>
        <li class="b-form__row g-clear">
            @Html.LabelFor(p => p.IsVisible)
            @Html.CheckBoxFor(p => p.IsVisible)
            @Html.HiddenFor(p => p.Id)
        </li>
        <li class="b-form__row b-form__row_buttons g-clear">
		    <input class="b-button" id="btnSave" name="btnSave" type="submit" value="Save" />    
		    <input class="b-button b-button_colour_grey" id="btnDelete" name="btnDelete" type="submit" value="Delete" />        	
        </li>
    </ol>
}
</fieldset>
}
<br />
<div id="newNodeContainer">
	<fieldset class="b-form">
		<ol class="b-form__rows ul-reset g-clear">
			<li class="b-form__row b-form__row_buttons g-clear">
				<button class="b-button" data-bind="click: viewSiteMapAddNode">Add new</button>
			</li>
		</ol>
	</fieldset>    
    <div id="newNodeForm" data-bind="visible: viewSiteMapEnabled">
        <fieldset class="b-form">
            <ol class="b-form__rows ul-reset g-clear">
                <li class="b-form__row g-clear">
                    <label for="NodeTitle">NodeTitle</label>
                    <input type="text" name="NodeTitle" class="text" data-bind="value: NodeTitle" />
                </li>
                <li class="b-form__row g-clear">
                    <label for="NodeDescription">NodeDescription</label>
                    <input type="text" name="NodeDescription" class="text" data-bind="value: NodeDescription" />
                </li>
                <li class="b-form__row g-clear">
                    <label for="NodeUrl">NodeUrl</label>
                    <input type="text" name="NodeUrl" class="text" data-bind="value: NodeUrl" />
                </li>
                <li class="b-form__row g-clear">
                    <label for="IsVisible">IsVisible</label>
                    <input type="checkbox" value="true" checked="checked" data-bind="checked: IsVisible" />
                    <input type="hidden" name="ParentNodeId" data-bind="value: ParentNodeId" />
                </li>   
                <li class="b-form__row b-form__row_buttons g-clear">
		            <button class="b-button" data-bind="click: viewSiteMapSaveNew">Save</button>
		        	<a class="b-button b-button_colour_grey" href="#" data-bind="click: viewSiteMapRemoveNode">Clear</a>                	
                </li>
            </ol>
        </fieldset>
    </div>
</div>